﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;

namespace Model
{
    public class AdviserInfo
    {
        public AdviserInfo()
        {
            AdviserID = string.Empty;
            AdviserName = string.Empty;
            Abstract = string.Empty;
            AttachmentList = new List<AttachmentInfo>();
        }

        /// <summary>
        /// 顾问专家编号
        /// </summary>
        public string AdviserID { get; set; }

        /// <summary>
        /// 顾问专家名字
        /// </summary>
        public string AdviserName { get; set; }

        /// <summary>
        /// 顾问专家简介
        /// </summary>
        public string Abstract { get; set; }

        /// <summary>
        /// 附件列表
        /// </summary>
        public IList<AttachmentInfo> AttachmentList { get; set; }

        public string AttarchmentString
        {
            get { return ""; }
            set
            {
                AttachmentList.Clear();

                if (!string.IsNullOrEmpty(value))
                {
                    string[] lines = value.Split('|');
                    foreach (var line in lines)
                    {
                        if (line.Length > 0)
                        {
                            string[] _sp = line.Split(':');

                            AttachmentList.Add(new AttachmentInfo { FileName = _sp[0], SaveName = _sp[1] });
                        }
                    }
                }
            }
        }
    }
}
